<?php

namespace App\Console\Commands\Assess;

use App\Services\Assess\OrderAndCustomersOrderService;
use Illuminate\Console\Command;

class SynCategory extends Command
{
    /**
     * linux定时同步订单 /usr/local/phpstudy/soft/php/php-7.4.0/bin/php /www/admin/winsdom_seller/artisan synCategory
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'synCategory
                            {--sku=}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '同步易仓平台商品分类信息';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {

        $sku = $this->option('sku');
        $OrderAndCustomersOrderService = new OrderAndCustomersOrderService();
        $params = [];
        if (!empty($sku)) $params['product_sku'] = $sku;

        $OrderAndCustomersOrderService->synCategory($params);
        $OrderAndCustomersOrderService->synCategoryPlatformSku($params);
        exit('SUCCESS');
    }
}



